//
//  CYHttps.h
//  CaiYun
//
//  Created by 今日信息科技 on 2017/8/10.
//  Copyright © 2017年 今日信息科技. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking.h>
typedef void(^progress)(NSProgress *progress);
typedef void(^success)(id data);
typedef void(^failure)(id string);
/**
 *@pragma 封装的网络工具类，是一个单例，用于管理网络请求
 */
@interface CYHttps : AFHTTPSessionManager
@property (nonatomic, assign) BOOL network;//网络连接
@property (nonatomic, assign) BOOL unknowmNetwork;//未知网络
@property (nonatomic, assign) BOOL WWANNetwork;//无线广域网／蜂窝服务
@property (nonatomic, assign) BOOL WiFiNetwork;//无限局域网／wlan/
+ (instancetype)shareCYHttpsManager;
/**
 *@pragma  检测网络状态
 */
+ (void)checkNetwork;
/**
 *@pragma异步并发从url加载图片
 */
+ (void)loadingWithFile:(NSString *)file complete:(void(^)(id data))complete;
/**
 *@pragma
 */
+ (NSURLSessionTask *)POST:(NSString *)API parameters:(id)dict success:(success)success failure:(failure)fail;
/**
 *@pragma
 */
+ (NSURLSessionTask *)POST:(NSString *)API parameters:(id)dict showHUD:(BOOL)show progress:(progress)block_progress success:(success)success failure:(failure)fail;
/**
 *@pragma
 */
+ (NSURLSessionTask *)GET:(NSString *)API parameters:(NSDictionary *)dict showHUD:(BOOL)show progress:(progress)block_progress success:(success)success failure:(failure)fail;
@end
